/*!
 @file MujiMediaAssetLoader.h
 @framework MujiCoreLibrary

 @author Created by Matt Austin on 7/23/14.
 @copyright Copyright (c) 2014 EnglishCentral, Inc. All rights reserved.
 
 @internal
*/

#import <Foundation/Foundation.h>
#import "MujiMediaAssetLoaderDelegate.h"
#import "MujiMediaAssetLoaderDataSource.h"

@class MujiMediaLoadRequest;

/*!
 @class MujiMediaAssetLoader
 */
@interface MujiMediaAssetLoader : NSObject

@property (nonatomic, weak) id<MujiMediaAssetLoaderDelegate> delegate;
@property (nonatomic, weak) id<MujiMediaAssetLoaderDataSource> dataSource;
@property (readonly, nonatomic, strong) MujiMediaLoadRequest *mediaRequest;
@property (readonly, nonatomic, strong) AVPlayer *player;
@property (readonly, nonatomic, strong) AVPlayerItem *playerItem;
@property (readonly, nonatomic, copy) AVURLAsset *urlAsset;
@property (nonatomic, copy) NSURL *mediaAssetURL;
@property (readonly, nonatomic, assign, getter = isLoadingMediaAsset) BOOL loadingMediaAsset;
@property (readonly, nonatomic, strong) NSError *error;
@property (readonly, nonatomic, assign) NSUInteger timeoutCounter;
@property (readonly, nonatomic, strong) NSTimer *timeout;

@property (nonatomic, assign) float duration;


- (void)loadMediaAsset:(NSURL *)mediaAsset;

- (void)scheduleTimeoutWithInterval:(NSTimeInterval)interval;

- (void)cancelTimeout;


@end




